package blockchain.mystream;

import java.io.IOException;
import java.net.ServerSocket;

public class MyServerSocketNoExcept {
    public ServerSocket serverSocket;
    public MyServerSocketNoExcept(int port) {
        try {
            serverSocket = new ServerSocket(port);
        } catch (IOException e) {
            System.out.println("服务端端口被占用");
        }
    }
    public MySocketNoExcept accept() {
        try {
            return new MySocketNoExcept(serverSocket.accept());
        } catch (IOException e) {
            System.out.println("建立连接失败");
        }
        return null;
    }
}
